﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace QuanLyNhaThuoc.Models
{
    public class PagingModel
    {
        // Constructor
        public PagingModel()
        {
            // Define any default values here...
            this.PageSize = 15;
            this.NumericPageCount = 10;
        }

        // Paging-related properties
        public int CurrentPageIndex { get; set; }
        public int PageSize { get; set; }
        public int TotalRecordCount { get; set; }
        public int PageCount
        {
            get
            {
                if (this.TotalRecordCount % this.PageSize == 0)
                {
                    return Math.Max(this.TotalRecordCount / this.PageSize, 1);
                }
                else
                {
                    return Math.Max((this.TotalRecordCount / this.PageSize)+1, 1);
                }
            }
        }
        public int NumericPageCount { get; set; }
    }
}